<?php
define('__ROOT__', dirname(dirname(__FILE__))); 
include_once(__ROOT__.'/includes/header.php'); 
?>
	<ul class="breadcrumb">
		<li>
			<a href="<?php echo base_url('/home'); ?>">Home</a> <span class="divider">/</span>
		</li>
		<li>
			<a href="<?php echo base_url('/articles'); ?>">Articles</a>
		</li>
		<?php if (isset($bookmark)): ?>
		<span class="divider">/</span>
		<li>
			<?php echo $bookmark; ?></a>
		</li>
		<?php endif;?>
	</ul>
	<div id="articles" class="span9 well">
  <?php foreach ($query as $entry) { ?>
  <div class="blog_entry">
    <h4><a href=<?php echo base_url('articles/entry/'. $entry->url_title); ?>><?php echo $entry->title; ?></a></h4>
    By <span class="metadata"><?php echo $entry->author; ?></span><br>
    <p class="articlesBtn"><?php echo $entry->summary; ?></p>
	<a href=<?php echo base_url('articles/entry/'. $entry->url_title); ?> class="btn-proper btn btn-small" style="color: #DDD">Read More</a>
  </div>
  <?php } ?>
  <?php if (strlen($pagination)): ?>
	   <div class="pagination">
		Pages: <?php echo $pagination; ?>
	   </div>
	<?php endif; ?>
  </div>
   <div id="oldpost" class="span2">
  
 <?php

 foreach($archives as $_year => $rows)
		{
			echo $_year. "<br>";
			echo '<ul>';
			foreach ($rows as $row)
			{
				echo '<li>'. '<a href="' . base_url('/articles/browse/'). '/'. $_year . '_' . $row->MONTH . '">'. $row->MONTH. " (" .$row->TOTAL. ")" . '</a></li>';
			}
			echo '</ul>';
		} ?>
  </div>
<?php
include_once(__ROOT__.'/includes/footer.php'); 
?>

